-- Leafy Glade
-- save Sarina

function autoexec()
  if (get_progress(P_GIRL) == 1) then
    set_ent_id(2, SARINA)
   
   else
    set_ent_active(0, 0)
    set_ent_active(1, 0)
    set_ent_active(2, 0)


  end     
return
end

function refresh()
  return
end

function postexec() 
  if (get_progress(P_GIRL) == 1) then 
    LOC_fight()
  else
  --do nothing
  end
return

end


function zone_handler(zn)
  if (zn == 1) then
    change_map("land","glade2_exit");

  elseif (zn == 2) then
    change_map("land","glade2_exit", 1, 1);


end
           


end

function LOC_fight() 
  set_autoparty(1)
  set_vfollow(1)
   
    bubble(2, "AHHH!")
    bubble(HERO1, "That does not sound good.")
    bubble(2, "Don't hurt me!") 
    set_ent_speed(HERO1, 5)
    move_entity(HERO1, "run_to")
    wait_for_entity(HERO1, 0)
    set_ent_facing(HERO1, FACE_RIGHT)
    set_ent_speed(HERO1, 4)
    bubble(0, "Quiet girl or we will make things difficult for you.")
    bubble(HERO1, "Let her go!")
    bubble(0, "Not on my watch!")
    bubble(1, "I bet this one's FATHER will pay a hefty ransom.")
    bubble(HERO1, "Let's settle this.")
    bubble(2, "I can't watch.")
    drawmap()
    screen_dump()
    set_run(0)
    combat(0)
    set_run(1)
    if (get_alldead() == 1) then
      return
    end
    set_progress(P_GIRL, 2)
    refresh()
    set_ent_active(0, 0)
    set_ent_active(1, 0)
    drawmap()
    screen_dump() 
    set_ent_facing(2, FACE_LEFT)
    bubble(2, "How can I ever repay you? You coming an saving me... me being a blue in all...")
    bubble(HERO1, "It was nothing.", "Why were you out here anyway?")
    bubble(2, "I thought I would try my hand at an adventure and then as you saw, I landed myself in trouble.")
    bubble(2, "I am in your debt. Thank you.")
    bubble(HERO1, "Its ok.")
    bubble(2, "I better get going.") 
    move_entity(2, "glade_enter")
    wait_for_entity(HERO1, 2)
    set_ent_active(2, 0)
 

end
 
-- 
function entity_handler(en)
  if (en == 0) then


      
  end
end
